package com.fzj.charging.device.canal;

import com.fzj.charging.device.pojo.entity.ChargingStationCanal;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import top.javatool.canal.client.annotation.CanalTable;
import top.javatool.canal.client.handler.EntryHandler;

@Component
@Slf4j
@CanalTable("charging_station")
public class StationSyncHandler implements EntryHandler<ChargingStationCanal> {
    @Override
    public void insert(ChargingStationCanal chargingStationCanal) {
        log.debug("数据表charging_station插入数据:{}",chargingStationCanal);
        log.debug("在redis中插入数据");
        EntryHandler.super.insert(chargingStationCanal);
    }

    @Override
    public void update(ChargingStationCanal before, ChargingStationCanal after) {
        log.debug("数据表charging_station更行数据，修改前{},修改后：{}",before,after);
        log.debug("在redis中修改数据");
        EntryHandler.super.update(before, after);
    }

    @Override
    public void delete(ChargingStationCanal chargingStationCanal) {
        log.debug("数据表charging_station删除数据:{}",chargingStationCanal);
        log.debug("在redis中删除数据");
        EntryHandler.super.delete(chargingStationCanal);
    }
}
